package com.zrrd.yt.order.client;

import com.zrrd.yt.common.result.Result;
import com.zrrd.yt.model.order.OrderInfo;
import com.zrrd.yt.order.client.impl.OrderFeignClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @author HongyueYang
 */
@FeignClient(value = "service-order",fallback = OrderFeignClientImpl.class)
public interface OrderFeignClient {

    //订单结算
    @GetMapping("/api/order/auth/trade")
    public Result<Map> trade();

    //获取订单信息
    @GetMapping("/api/order/inner/getOrderInfo/{orderId}")
    public OrderInfo getOrderInfo(@PathVariable("orderId") Long orderId);

    //提交秒杀订单
    @PostMapping("/api/order/inner/seckill/submitOrder")
    public Long submitOrder(@RequestBody OrderInfo orderInfo);
}
